package com.hulk.ratel.service.dto;


import io.swagger.annotations.ApiModelProperty;

import lombok.*;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;

import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author cmt
 *
 */

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ToString
public class BaseDTO implements Serializable {
	
	private static final long serialVersionUID = 1L;
	@ApiModelProperty(value="版本",name="version",dataType="String",required= true, example="1.0.0")
	@Getter
	@Setter
	@NotBlank(message="{up.basedto.version}")
	@Length(min=0,max=16,message="{up.basedto.version}")
	private String version="";
	@ApiModelProperty(value="字符集",name="charset",dataType="String",required= true, example="UTF-8")
	@Getter
	@Setter
	@NotBlank(message="{up.basedto.charset}")
	@Pattern(regexp="^(utf\\-8|UTF\\-8){1}$",message="{up.basedto.charset}")//判断是否等于UTF-8  //TODO
	private String charset="";
	@ApiModelProperty(value="合作方编号",name="partnerNo",dataType="String",required= true)
	@Getter
	@Setter
	@NotBlank(message="{up.basedto.partnerNo}")
	@Length(min=0,max=16,message="{up.basedto.partnerNo}")
	@Pattern(regexp = "^[a-zA-Z0-9]+$" ,message="{up.basedto.partnerNo}") 
	private String partnerNo="";
	@ApiModelProperty(value="合作方类型",name="partnerNo",dataType="String")
	@Getter
	@Setter
	@NotBlank(message="{up.basedto.partnerType}")
	@Length(min=1,max=16,message="{up.basedto.partnerType}")
	//@Pattern(regexp = "OUTER|INNER|MERCHANT{1}" ,message="{up.basedto.partnerType}")
	private String partnerType="";
	@ApiModelProperty(value="交易代码",name="txnCode",dataType="String",required= true)
	@Getter
	@Setter
	@NotBlank(message="{up.basedto.txnCode}")
	@Length(min=1,max=32,message="{up.basedto.txnCode}")
	@Pattern(regexp = "^[a-zA-Z0-9_]+$" ,message="{up.basedto.txnCode}")
	private String txnCode="";
	@ApiModelProperty(value="交易流水",name="traceId",dataType="String",required= true)
	@Getter
	@Setter
	@NotBlank(message="{up.basedto.traceId}")
	@Length(min=18,max=32,message="{up.basedto.traceId}")
	@javax.validation.constraints.NotBlank
	//@Pattern(regexp = "^[0-9]+$" ,message="{up.basedto.traceId}")
    private String traceId="";

}
